package net.magicalcloud.magicalcloud.view.viewImpl.fragment;

import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import net.magicalcloud.magicalcloud.R;
import net.magicalcloud.magicalcloud.adapter.SharesAdapter;
import net.magicalcloud.magicalcloud.base.BaseFragment;
import net.magicalcloud.magicalcloud.entity.Shares;
import net.magicalcloud.magicalcloud.presenter.SharePresenter;
import net.magicalcloud.magicalcloud.view.IShareView;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.jzvd.JZVideoPlayerStandard;

/**
 * 第二页 分享
 * Created by Pei on 2018/6/7.
 */

public class ShareFragment extends BaseFragment<IShareView,SharePresenter> implements IShareView{
    @BindView(R.id.searchListView)
    RecyclerView searchList;
    private SharesAdapter adapter;
    private View view;

    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        view = inflater.inflate(R.layout.fragment_share, container, false);
        //绑定ButterKnife
        ButterKnife.bind(this,view);

        adapter=new SharesAdapter();
//        LinearLayoutManager linearLayoutManager=new LinearLayoutManager(getContext());
//        searchList.setLayoutManager(linearLayoutManager);
//        searchList.setAdapter(adapter);

       // mPresenter.showShares();
        return view;
    }


    @Override
    protected SharePresenter createPresenter() {
        return new SharePresenter();
    }

    @Override
    public void setList(List<Shares> sharesList) {
        adapter.setData(sharesList);
    }
}
